<?php

defined('_JEXEC') or die('Restricted access');

jimport('joomla.application.component.modeladmin');

class CouponsModelShop extends JModelAdmin
{    
    private $data;
    
    public function getTable($type = 'Shop', $prefix = 'Table', $config = array())
    {
        return JTable::getInstance($type, $prefix, $config); 
    }
    
    public function getForm($data = array(), $loadData = true) 
    {
        $form = $this->loadForm('com_coupons.shop', 'shop', array('control' => 'jform', 'load_data' => $loadData));
        if (empty($form))
            return false;
        return $form;
    }
    
    protected function loadFormData()
    {
        if (empty($this->data)) 
            $this->data = $this->getItem();

        return $this->data;
    }
    
    protected function canDelete($record)
    {
        return !empty($record->id);
    }
}

?>
